/*
 * GbtTypeName.h
 *
 *  Created on: 2018年5月14日
 *      Author: zhengboyuan
 */

#ifndef GBTTYPENAME_H_
#define GBTTYPENAME_H_

#include "GbtType.h"


#ifdef __cplusplus
extern "C" {
#endif
///////////////////////////////////////////////////////////////////


typedef struct GBT_TypeName
{
    int type;
    const char* name;
} GBT_TypeName;


DLLEXPORT const char* gbtTypeGetName(GBT_TypeName* names, size_t count, int value);

DLLEXPORT int gbtTypeGetType(GBT_TypeName* names, size_t count, const char* name, int defValue);
DLLEXPORT BOOL gbtTypeParseName(GBT_TypeName* names, size_t count, const char* name, int* value);
DLLEXPORT int gbtTypeGetTypeNoCase(GBT_TypeName* names, size_t count, const char* name, int defValue);

DLLEXPORT int gbtTypeGetTypeEx(GBT_TypeName* names, size_t count, const char* name, size_t len, int defValue);
DLLEXPORT int gbtTypeGetTypeExNoCase(GBT_TypeName* names, size_t count, const char* name, size_t len, int defValue);
DLLEXPORT BOOL gbtTypeParseNameEx(GBT_TypeName* names, size_t count, const char* name, size_t len, int* value);

DLLEXPORT GBT_TypeName* gbtTypeListStreamOperation(size_t* count);

DLLEXPORT GBT_TypeName* gbtTypeListCommandType(size_t* count);
DLLEXPORT GBT_CommandType gbtTypeGetCommandType(const char* name, GBT_CommandType defValue);
DLLEXPORT const char* gbtNameGetCommandType(int type);

DLLEXPORT const char* gbtNameGetStreamOperation(int op);
DLLEXPORT GBT_StreamOperation  gbtTypeGetStreamOperation(const char* name, GBT_StreamOperation defValue);

DLLEXPORT const char* gbtNameGetStatus(int status);
DLLEXPORT GBT_Status  gbtTypeGetStatus(const char* name, GBT_Status defValue);

DLLEXPORT const char* gbtNameGetOnline(int value);
DLLEXPORT GBT_Online gbtTypeGetOnline(const char* name, GBT_Online defValue);

DLLEXPORT const char* gbtNameGetOnOff(int value);
DLLEXPORT GBT_OnOff gbtTypeGetOnOff(const char* name, GBT_OnOff defValue);

DLLEXPORT const char* gbtNameGetDutyStatus(int value);
DLLEXPORT GBT_DutyStatus gbtTypeGetDutyStatus(const char* name, GBT_DutyStatus defValue);

DLLEXPORT const char* gbtNameGetResult(int value);
DLLEXPORT GBT_ResultType  gbtTypeGetResult(const char* name, GBT_ResultType defValue);


DLLEXPORT const char* gbtNameGetRecordCmd(int cmd);
DLLEXPORT GBT_RecordCmdType gbtTypeGetRecordCmd(const char* name, GBT_RecordCmdType defValue);

DLLEXPORT const char* gbtNameGetGuardCmd(int cmd);
DLLEXPORT GBT_GuardCmdType gbtTypeGetGuardCmd(const char* name, GBT_GuardCmdType defValue);

DLLEXPORT const char* gbtNameGetRecordType(int type);
DLLEXPORT GBT_RecordType gbtTypeGetRecordType(const char* name, GBT_RecordType defValue);


///////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif

#endif /* GBTTYPENAME_H_ */
